﻿using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using MyAuthCore.Entity;
using MyAuthCore.Entity.Beans;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;

namespace MyAuthCore.Api
{
    public class Core
    {
        public IConfiguration Configuration { get; }
        public Core(IConfiguration configuration)
        {
            Configuration = configuration;
        }
        public void Run()
        {
  
            SqlSugarHelper.ConnectionString = Configuration["DataBase:ConnectionString"];
            SqlSugarHelper.DBType = Configuration["DataBase:Type"];
            //建表
            SqlSugarHelper.CodeFirst.CodeFirst.InitTables(
                typeof(User),
                typeof(Role),
                typeof(Module),
                typeof(Organization),
                typeof(Application),
                typeof(Category),
                typeof(ModuleElement),
                typeof(File));

        }
    }

  
}
